/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine SDK - core/memory
// Copyright( c) 2013.  All Rights Reserved
//
// File:		AEMemoryManager.h
// Author:		Gianluca Belardelli
// Date:		02/01/2014
//
/////////////////////////////////////////////////////////////////////////
#include <AECore.h>

#define DEFAULT_STACK_SIZE	( 1 << 14 )	// 16K

AE_THREAD_LOCAL(AEMemoryManager *) AEMemoryManager::m_lpInstance;

AEMemoryManager::AEMemoryManager( void ) : m_Stack( DEFAULT_STACK_SIZE, "MemMgrInternal" )
{
	//m_lpInstance.SetData( this );
	AE_THREAD_LOCAL_SET( m_lpInstance, this );
}

void AE_CALL AEMemoryManager::ReplaceInstance( AEMemoryManager *lpPtr )
{
	AE_THREAD_LOCAL_SET( m_lpInstance, lpPtr );
}
